package com.longge;

import java.util.HashSet;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-06-01 01:44
 */
public class DistributeCandiesI {
    public int distributeCandies(int[] candyType) {

        HashSet<Integer> set = new HashSet<>();
        for (int i : candyType) {
            set.add(i);
        }
        int size = set.size();
        return candyType.length / 2 > size ? size : candyType.length / 2;
    }
}
